package com.plz.afmt.controller;

//import com.plz.afmt.common.CommonService;
import com.plz.afmt.common.CommonService;
import com.plz.afmt.dto.EnterprisesQueryDto;
import com.plz.afmt.dto.WeChatLoginDTO;
import com.plz.afmt.service.SysParamsService;
import com.plz.afmt.service.UserService;
import com.plz.afmt.vo.UserVo;
import com.plz.web.base.controller.BaseController;
import com.plz.web.base.dto.Resp;
import com.plz.web.base.dto.Resq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 登录接口
 *
 * @author Mark sunlightcs@gmail.com
 */

@RestController
@RequestMapping("/api/oauth")
@Api(tags="登录接口")
public class OauthController extends BaseController {
    @Autowired
    private CommonService commonService;

    @PostMapping("miniAppLogin")
    @ApiOperation("小程序登陆")
    public Resp<UserVo> miniAppLogin(@RequestBody Resq<WeChatLoginDTO> requestBean){
        WeChatLoginDTO dto = getReqData(requestBean);
        UserVo userVo = commonService.miniAppLogin(dto);
        return getRes(userVo);
    }


}